<%= render 'menu/caidau'%>
<p style="color: red"><%= label_tag params[:alert] %></p>
<p style="color: green"><%= label_tag params[:alert1] %></p>
<table>
	<tr valign="top">
		<td>
			<table class="vienxanh">
					<tr>
					<th>Title</th>
					<th>Date</th>
					<th>View Details</th>
					</tr>
					<% if !@fromAdmin.nil? 
					@fromAdmin.each do |m| %>
					<tr>
						<td><%= m.Title%></td>
						<td><%= m.Date_sent.strftime("%d-%m-%Y")%></td>
						<td><%= link_to 'View Details',:action=>'viewdetail',:mes=>m.id %>
					</tr>	
					
					<%end end%>
										
				</table>
			
		</td>
		<% if !session[:md].nil?
	@md=session[:md]
	 %>
		<td>
	<fieldset align="left">
					<legend><h2>Message Detail</h2></legend>		

	Title: <%=@md.Title%><br/>
	Date: <%= @md.Date_sent.strftime("%d-%m-%Y")%><br/>
	Content:<br/>
	<textarea ><%=@md.Content%></textarea> <br/>
	<%= link_to 'Delete', :action=>'xoamessage'%>
	
			</fieldset>
		</td>
		<% end%>
		<td>
			<fieldset align="left">
					<legend><h2>Send message to admin</h2></legend>	
			
<%= form_tag :action => 'sendmess' do%>
			Title:
				<%= text_field_tag 'title'%> <br/>
			Content:<br/>
				<%= text_area_tag 'newmess','',{:rows=>10, :cols=>50} %> <br /> <br />
				<%= submit_tag "Submit"%> <br /> <br />
<% end %>
			</fieldset>
		</td>
		
	</tr>
</table>




